package com.campus.service.impl;

import com.campus.dao.StudentDao;
import com.campus.model.Student;
import com.campus.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @desc: 学员服务实现类
 * @author: hjm
 * @date: 2024/11/22
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;

    /**
     * 新增学员
     *
     * @param student 学员对象
     * @return 受影响的行数
     */
    @Override
    public int createStudent(Student student) {
        return studentDao.createStudent(student);
    }

    /**
     * 批量导入学员
     *
     * @param students 学员对象列表
     * @return 受影响的行数
     */
    @Override
    public int batchCreateStudents(List<Student> students) {
        return studentDao.batchCreateStudents(students);
    }

    /**
     * 审核学员
     *
     * @param id 学员ID
     * @return 受影响的行数
     */
    @Override
    public int approveStudent(int id) {
        return studentDao.approveStudent(id);
    }

    /**
     * 批量审核学员
     *
     * @param studentIds 学员ID列表
     * @return 受影响的行数
     */
    @Override
    public int batchApproveStudents(List<Integer> studentIds) {
        return studentDao.batchApproveStudents(studentIds);
    }
}